# Contributor: Luca Weiss <luca@z3ntu.xyz>
# Maintainer: Luca Weiss <luca@z3ntu.xyz>
pkgname=ayatana-indicator-keyboard
pkgver=24.2.0
pkgrel=0
pkgdesc="Ayatana Indicator Keyboard Applet"
url="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard"
arch="all !s390x !riscv64" # blocked by accountsservice-dev
license="GPL-3.0-only"
makedepends="
	accountsservice-dev
	cmake
	cmake-extras
	glib-dev
	intltool
	libayatana-common-dev
	libx11-dev
	libxkbcommon-dev
	libxklavier-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-lang"
source="https://github.com/AyatanaIndicators/ayatana-indicator-keyboard/archive/$pkgver/ayatana-indicator-keyboard-$pkgver.tar.gz"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DENABLE_TESTS=ON \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
a30dfe311409de3db438cf9f6280837c8548fdc8105528765e79ae27dceed4f954883f874323f2550f435cd7db1db7fa822515e39febf3699a1f8d485b9d7664  ayatana-indicator-keyboard-24.2.0.tar.gz
"
